package com.markerhub.service.impl;

import com.markerhub.entity.TeachingStudentLearning;
import com.markerhub.mapper.TeachingStudentLearningMapper;
import com.markerhub.service.TeachingStudentLearningService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TeachingStudentLearningServiceImpl extends ServiceImpl<TeachingStudentLearningMapper, TeachingStudentLearning> implements TeachingStudentLearningService {

    @Autowired
    private TeachingStudentLearningMapper learningMapper;

    public List<Map<String, Object>> getStudentProgress(Integer unitId, Integer classId) {
        if (unitId == null || classId == null) {
            throw new IllegalArgumentException("单元ID和班级ID不能为空");
        }
        return learningMapper.getStudentProgress(unitId, classId);
    }
}
